package com.book.entity;/**
 * Created by CoolWen on 2017/3/29.
 */

import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Size;

/**
 * @author CoolWen
 * @version 2017-03-29 22:31
 */
public class User {

    @NotEmpty(message = "用户名不能为空")
    private String username;


    @NotEmpty(message = "用户名不能为空")
    private String nickname;

    @Size(min = 3, max = 10, message = "密码的长度为3到10位")
    private String password;

    public User() {
    }

    public User(String username, String nickname, String password) {
        this.username = username;
        this.nickname = nickname;
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", nickname='" + nickname + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
